package com.purchase.ml.service.order;

import com.purchase.ml.bean.base.ApiRestResult;
import com.purchase.ml.bean.page.Page;
import com.purchase.ml.bean.req.order.*;
import com.purchase.ml.bean.req.shoppingcart.ProductCartReq;
import com.purchase.ml.bean.res.dashboard.OrderRecentQueryRes;
import com.purchase.ml.bean.res.order.OrderInvoiceQueryInfoRes;
import com.purchase.ml.bean.res.order.OrderInvoiceQueryRes;
import com.purchase.ml.bean.res.order.OrderQueryInfoRes;
import com.purchase.ml.bean.res.order.OrderQueryRes;
import com.purchase.ml.bean.vo.order.OrderRedisVo;
import com.sun.org.apache.xpath.internal.operations.Bool;

import java.security.NoSuchAlgorithmException;
import java.util.List;

/**
 * Created by kyyang on 2021/2/28 19:30
 */
public interface SysOrderService {

    /**
     * @description: 订单创建
     * @author kyyang
     * @date 2021/2/28 19:33
     * @version 1.0
     */
    ApiRestResult orderCreate(OrderAddReq orderAddReq) throws NoSuchAlgorithmException;

    /**
     * @description: 管理员添加订单
     * @author kyyang
     * @date 2021/2/28 19:33
     * @version 1.0
     */
    ApiRestResult orderAdminCreate(OrderAdminAddReq req);

    /**
     * @description: 订单查询
     * @author kyyang
     * @date 2021/2/28 22:01
     * @version 1.0
     */
    Page<OrderQueryRes> orderQuery(OrderQueryReq orderQueryReq,Boolean isMyOrder);

    /**
     * @description: 查询出售者为自己的最近的5条订单
     * @author kyyang
     * @date 2021/2/28 22:01
     * @version 1.0
     */
    List<OrderRecentQueryRes> orderRecentQuery();

    /**
     * @description: 查询所有发票
     * @author kyyang
     * @date 2021/3/1 22:01
     * @version 1.0
     */
    Page<OrderInvoiceQueryRes> orderInvoiceQuery(OrderInvoiceQueryReq req);

    /**
     * @description: 汇总昨日订单
     * @author kyyang
     * @date 2021/3/2 19:12
     * @version 1.0
     */
    void jobOrderCollect();

    /**
     * @description: 修改订单状态
     * @author kyyang
     * @date 2021/3/9 22:26
     * @version 1.0
     */
    ApiRestResult orderEdit(OrderEditReq orderEditReq);

    /**
     * @description: 修改订单状态
     * @author daizh
     * @date 2021/3/18 22:26
     * @version 1.0
     */
    int changeOrderState(OrderEditReq orderEditReq);
    /**
     * @description: 软删除
     * @author daizh
     * @date 2021/3/17 22:26
     * @version 1.0
     */
    ApiRestResult orderDel(List<Long> oids);

    /**
     * @description: 往 redis 订单集合中增加 订单
     * @author kyyang
     * @date 2021/3/13 16:35
     * @version 1.0
     */
    ApiRestResult orderSetRedisAdd(OrderRedisVo orderRedisVo);


    /**
     * @description:  redis 订单集合中 删除 订单
     * @author kyyang
     * @date 2021/3/13 16:35
     * @version 1.0
     */
    ApiRestResult orderSetRedisDel(OrderRedisVo orderRedisVo);


    /**
     * @description: 查询 redis 订单集合中
     * @author kyyang
     * @date 2021/3/13 17:15
     * @version 1.0
     */
    List<OrderRedisVo> queryOrderSetRedisBySub(int start,int end);

    /**
     * @description: 通过单号查询订单详情
     * @author kyyang
     * @date 2021/3/20 18:16
     * @version 1.0
     */
    OrderQueryInfoRes orderQueryInfo(OrderQueryInfoReq orderQueryInfoReq, boolean b);

    /**
     * @description: 通过单号查询发票详情
     * @author kyyang
     * @date 2021/3/20 18:30
     * @version 1.0
     */
    OrderInvoiceQueryInfoRes orderInvoiceQueryInfo(OrderInvoiceQueryInfoReq orderInvoiceQueryInfoReq);
}
